package com.yundashi.updateapputils.util;


import android.content.Context;
import android.content.Intent;
import android.util.Log;

import org.json.JSONArray;
import org.json.JSONObject;

import java.io.DataOutputStream;
import java.io.File;

public class YoubaoUtils {

    public static void youbao_install(Context context, String path){
        Log.e("YoubaoUtils", "youbao_install path:" + path);
        JSONArray arr = new JSONArray();
        JSONObject obj = new JSONObject();
        try {
            obj.put("install", true);
            obj.put("path", path);
        } catch(Exception e) {
            e.printStackTrace();
        }
        arr.put(obj);

        Intent intent = new Intent("com.ubox.install");
        intent.putExtra("pmaction", "com.ubox.update.install");
        intent.putExtra("pmdata", arr.toString());
        intent.setFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
        context.sendBroadcast(intent);
    }













}
